import request from '@/utils/request'

function treeData () {
  return request({
    url: '/auth/tree',
    method: 'get'
  });
}

function listData (param) {
  return request({
    url: '/auth/list',
    method: 'get',
    params: param
  });
}

function addAuth (data) {
  return request({
    url: '/auth/add',
    method: 'post',
    data
  });
}

function editAuth (data) {
  return request({
    url: '/auth/update',
    method: 'post',
    data
  });
}

function delAuth (id) {
  return request({
    url: '/auth/delet',
    method: 'get',
    params: {
      id: id
    }
  });
}

function getById (id) {
  return request({
    url: '/auth/info',
    method: 'get',
    params: {
      id: id
    }
  });
}

export {
  treeData,
  listData,
  addAuth,
  editAuth,
  delAuth,
  getById
}
